package labox.innovation.gameserver.taskmanager.tasks;

import labox.innovation.gameserver.Shutdown;
import labox.innovation.gameserver.taskmanager.Task;
import labox.innovation.gameserver.taskmanager.TaskManager.ExecutedTask;

/**
 * 关闭服务器任务
 * 
 */
public class TaskShutdown extends Task {
	public static final String NAME = "shutdown";

	/**
	 * 
	 * @see labox.innovation.gameserver.taskmanager.Task#getName()
	 */
	@Override
	public String getName() {
		return NAME;
	}

	/**
	 * 
	 * @see labox.innovation.gameserver.taskmanager.Task#onTimeElapsed(labox.innovation.gameserver.taskmanager.TaskManager.ExecutedTask)
	 */
	@Override
	public void onTimeElapsed(ExecutedTask task) {
		Shutdown handler = new Shutdown(Integer.parseInt(task.getParams()[2]), false);
		handler.start();
	}

}
